var app = getApp()
Page({
  data: {
    
  },
  onLoad: function (e) {
    var that = this;
    that.requestCardDetail();
  },
  onShow: function () {
    var that = this;
    app.setNavtitle('我的二维码');
  },
  // 请求会员卡详情
  requestCardDetail: function () {
    var that = this;
    var cardid = that.data.cardid;
    app.setVersion(that);
    wx.showLoading({
      title: '加载中',
    })
    wx.request({
      url: app.globalData.requestUrl,
      data: {
        map: 'applet_member_card_qrcode'
      },
      success: function (res) {
        console.log(res.data);
        if (res.data.ec == 200) {
          that.setData({
            cardCodeInfo: res.data.data
          })
          console.log(that.data.cardDetail);
        } else {
          that.setData({
            cardCodeInfo: ''
          })
          console.log(res.data)
          app.errorTip(that, res.data.em, 2000);
        }
      },
      complete: function () {
        wx.hideLoading();
        wx.stopPullDownRefresh();
      }
    });
  },
})